/**
 * Copyright (C) 2013 Christos Koufogiannakis
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.easychart.demo;

import java.util.ArrayList;
import java.util.Arrays;

import com.easychart.chart.MultiLineChart;

import android.app.Activity;
import android.os.Bundle;

/**
 * Example full screen MultiLineChart
 */
public class ExampleMultiLineChart extends Activity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		ArrayList<String> xLabels = new ArrayList<String>(
				Arrays.asList("2001", "2002", "2003", "2004", "2005", "2006","2007", "2008", "2009", "2010", "2011", "2012"));		
		
		ArrayList<Double> line1Values =  new ArrayList<Double>(
				Arrays.asList(165d, 175d, 180d, 178d, 182d, 185d, 189d, 188d, 195d, 195d, 194d, 190d));
		ArrayList<Double> line2Values =  new ArrayList<Double>(
				Arrays.asList(140d, 145d, 150d, 158d, 162d, 160d, 172d, 165d, 170d, 170d, 168d, 168d));
		ArrayList<Double> line3Values =  new ArrayList<Double>(
				Arrays.asList(120d, 125d, 130d, 138d, 142d, 150d, 152d, 150d, 150d, 150d, 154d, 156d));
		
		MultiLineChart multiLineChart = new MultiLineChart(this);
		multiLineChart.setXLabels(xLabels);
		multiLineChart.addLine(line1Values, "Downtown");
		multiLineChart.addLine(line2Values, "Suburb");
		multiLineChart.addLine(line3Values, "Industrial area");	
		multiLineChart.setXTile("Year");
		multiLineChart.setYTile("USD ($)");
		multiLineChart.setPlotTitle("Average Monthly Rent");	
		multiLineChart.getParameters().SHOW_HORIZONTAL_GRID.setValue(true);
		
		setContentView(multiLineChart);
	}
}